\(\int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx\) [351]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 69 \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {b \arctan (\sinh (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a \log (\cosh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a \log (a+b \sinh (c+d x))}{\left (a^2+b^2\right ) d} \]

[Out]

b*arctan(sinh(d*x+c))/(a^2+b^2)/d+a*ln(cosh(d*x+c))/(a^2+b^2)/d-a*ln(a+b*sinh(d*x+c))/(a^2+b^2)/d

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2800, 815, 649, 209, 266} \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {b \arctan (\sinh (c+d x))}{d \left (a^2+b^2\right )}-\frac {a \log (a+b \sinh (c+d x))}{d \left (a^2+b^2\right )}+\frac {a \log (\cosh (c+d x))}{d \left (a^2+b^2\right )} \]

[In]

Int[Tanh[c + d*x]/(a + b*Sinh[c + d*x]),x]

[Out]

(b*ArcTan[Sinh[c + d*x]])/((a^2 + b^2)*d) + (a*Log[Cosh[c + d*x]])/((a^2 + b^2)*d) - (a*Log[a + b*Sinh[c + d*x
]])/((a^2 + b^2)*d)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {x}{(a+x) \left (-b^2-x^2\right )} \, dx,x,b \sinh (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (\frac {a}{\left (a^2+b^2\right ) (a+x)}+\frac {-b^2-a x}{\left (a^2+b^2\right ) \left (b^2+x^2\right )}\right ) \, dx,x,b \sinh (c+d x)\right )}{d} \\ & = -\frac {a \log (a+b \sinh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {\text {Subst}\left (\int \frac {-b^2-a x}{b^2+x^2} \, dx,x,b \sinh (c+d x)\right )}{\left (a^2+b^2\right ) d} \\ & = -\frac {a \log (a+b \sinh (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a \text {Subst}\left (\int \frac {x}{b^2+x^2} \, dx,x,b \sinh (c+d x)\right )}{\left (a^2+b^2\right ) d}+\frac {b^2 \text {Subst}\left (\int \frac {1}{b^2+x^2} \, dx,x,b \sinh (c+d x)\right )}{\left (a^2+b^2\right ) d} \\ & = \frac {b \arctan (\sinh (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a \log (\cosh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a \log (a+b \sinh (c+d x))}{\left (a^2+b^2\right ) d} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.07 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.03 \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {(a-i b) \log (i-\sinh (c+d x))+(a+i b) \log (i+\sinh (c+d x))-2 a \log (a+b \sinh (c+d x))}{2 \left (a^2+b^2\right ) d} \]

[In]

Integrate[Tanh[c + d*x]/(a + b*Sinh[c + d*x]),x]

[Out]

((a - I*b)*Log[I - Sinh[c + d*x]] + (a + I*b)*Log[I + Sinh[c + d*x]] - 2*a*Log[a + b*Sinh[c + d*x]])/(2*(a^2 +
 b^2)*d)

Maple [A] (verified)

Time = 1.06 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.41

method result size
derivativedivides \(\frac {\frac {2 a \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )+4 b \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{2}+2 b^{2}}-\frac {2 a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{2 a^{2}+2 b^{2}}}{d}\) \(97\)
default \(\frac {\frac {2 a \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )+4 b \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{2}+2 b^{2}}-\frac {2 a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{2 a^{2}+2 b^{2}}}{d}\) \(97\)
risch \(-\frac {2 a \,d^{2} x}{a^{2} d^{2}+b^{2} d^{2}}-\frac {2 a d c}{a^{2} d^{2}+b^{2} d^{2}}+\frac {2 a x}{a^{2}+b^{2}}+\frac {2 a c}{d \left (a^{2}+b^{2}\right )}+\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right ) b}{\left (a^{2}+b^{2}\right ) d}+\frac {\ln \left ({\mathrm e}^{d x +c}+i\right ) a}{\left (a^{2}+b^{2}\right ) d}-\frac {i \ln \left ({\mathrm e}^{d x +c}-i\right ) b}{\left (a^{2}+b^{2}\right ) d}+\frac {\ln \left ({\mathrm e}^{d x +c}-i\right ) a}{\left (a^{2}+b^{2}\right ) d}-\frac {a \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 a \,{\mathrm e}^{d x +c}}{b}-1\right )}{d \left (a^{2}+b^{2}\right )}\) \(216\)

[In]

int(tanh(d*x+c)/(a+b*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(4/(2*a^2+2*b^2)*(1/2*a*ln(1+tanh(1/2*d*x+1/2*c)^2)+b*arctan(tanh(1/2*d*x+1/2*c)))-2*a/(2*a^2+2*b^2)*ln(ta
nh(1/2*d*x+1/2*c)^2*a-2*b*tanh(1/2*d*x+1/2*c)-a))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.33 \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {2 \, b \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right ) - a \log \left (\frac {2 \, {\left (b \sinh \left (d x + c\right ) + a\right )}}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + a \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{{\left (a^{2} + b^{2}\right )} d} \]

[In]

integrate(tanh(d*x+c)/(a+b*sinh(d*x+c)),x, algorithm="fricas")

[Out]

(2*b*arctan(cosh(d*x + c) + sinh(d*x + c)) - a*log(2*(b*sinh(d*x + c) + a)/(cosh(d*x + c) - sinh(d*x + c))) +
a*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))))/((a^2 + b^2)*d)

Sympy [F]

\[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\int \frac {\tanh {\left (c + d x \right )}}{a + b \sinh {\left (c + d x \right )}}\, dx \]

[In]

integrate(tanh(d*x+c)/(a+b*sinh(d*x+c)),x)

[Out]

Integral(tanh(c + d*x)/(a + b*sinh(c + d*x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.38 \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {2 \, b \arctan \left (e^{\left (-d x - c\right )}\right )}{{\left (a^{2} + b^{2}\right )} d} - \frac {a \log \left (-2 \, a e^{\left (-d x - c\right )} + b e^{\left (-2 \, d x - 2 \, c\right )} - b\right )}{{\left (a^{2} + b^{2}\right )} d} + \frac {a \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{{\left (a^{2} + b^{2}\right )} d} \]

[In]

integrate(tanh(d*x+c)/(a+b*sinh(d*x+c)),x, algorithm="maxima")

[Out]

-2*b*arctan(e^(-d*x - c))/((a^2 + b^2)*d) - a*log(-2*a*e^(-d*x - c) + b*e^(-2*d*x - 2*c) - b)/((a^2 + b^2)*d)
+ a*log(e^(-2*d*x - 2*c) + 1)/((a^2 + b^2)*d)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.75 \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {\frac {2 \, a b \log \left ({\left | b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 2 \, a \right |}\right )}{a^{2} b + b^{3}} - \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} b}{a^{2} + b^{2}} - \frac {a \log \left ({\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4\right )}{a^{2} + b^{2}}}{2 \, d} \]

[In]

integrate(tanh(d*x+c)/(a+b*sinh(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(2*a*b*log(abs(b*(e^(d*x + c) - e^(-d*x - c)) + 2*a))/(a^2*b + b^3) - (pi + 2*arctan(1/2*(e^(2*d*x + 2*c)
 - 1)*e^(-d*x - c)))*b/(a^2 + b^2) - a*log((e^(d*x + c) - e^(-d*x - c))^2 + 4)/(a^2 + b^2))/d

Mupad [B] (verification not implemented)

Time = 2.04 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.88 \[ \int \frac {\tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {\ln \left ({\mathrm {e}}^{c+d\,x}+1{}\mathrm {i}\right )}{a\,d-b\,d\,1{}\mathrm {i}}-\frac {a\,\ln \left (8\,a^3\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c-b^3-4\,a^2\,b+b^3\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+4\,a^2\,b\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+2\,a\,b^2\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\right )}{d\,a^2+d\,b^2}+\frac {\ln \left (1+{\mathrm {e}}^{c+d\,x}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-b\,d+a\,d\,1{}\mathrm {i}} \]

[In]

int(tanh(c + d*x)/(a + b*sinh(c + d*x)),x)

[Out]

log(exp(c + d*x) + 1i)/(a*d - b*d*1i) + (log(exp(c + d*x)*1i + 1)*1i)/(a*d*1i - b*d) - (a*log(8*a^3*exp(d*x)*e
xp(c) - b^3 - 4*a^2*b + b^3*exp(2*c)*exp(2*d*x) + 4*a^2*b*exp(2*c)*exp(2*d*x) + 2*a*b^2*exp(d*x)*exp(c)))/(a^2
*d + b^2*d)